<html>
    <head>
	<script language="JavaScript" type='text/javascript' src='/dwrstudy/dwr/engine.js'></script>
	<script language="JavaScript" type='text/javascript' src='/dwrstudy/dwr/util.js'></script>
	<script language="JavaScript" type='text/javascript' src='/dwrstudy/dwr/interface/HelloWorld.js'></script>
	<script language="JavaScript" type='text/javascript' src='/dwrstudy/dwr/interface/ErrorHandler.js'></script>
	
	<title>Error Handler</title>
	<script language="JavaScript">
		dwr.engine.setErrorHandler(function globalHandle() {alert("This is globalHandler!")});
		function testGlobalHandle() {
			ErrorHandler.testGlobalErrorHandler(function(data) {
				alert(data);
			});
		}
		function testMethodHandle() {
			ErrorHandler.testMethodErrorHandler({
				callback:function(data) {alert(data);},
				errorHandler:function(errorString, exception) {
					alert(errorString);
					alert(exception);
				}
			});
		}
		function testBatchHandle() {
			DWREngine.beginBatch();
	
			ErrorHandler.testBatchErrorHandler1(function(data) {alert(data)});
			ErrorHandler.testBatchErrorHandler2(function(data) {alert(data)});
			ErrorHandler.testBatchErrorHandler3(function(data) {alert(data)});
	
			DWREngine.endBatch({
				errorHandler:function batchHandle() {alert("This is batchHandler!")}
			});
		}
	</script>
	</head>
	
	<body >
	
	<br/>
	<input type="button" value="testGlobalHandle" onclick="testGlobalHandle()"/>
	<input type="button" value="testMethodHandle" onclick="testMethodHandle()"/>
	<input type="button" value="testBatchHandle" onclick="testBatchHandle()"/>
	</body>
</html>
